#pragma once
#include "../render/render.hpp"

namespace qbe::axis {
enum struct DrawBoxDirect : uint8_t {
  None = 0,
  Left = 1,
  Right = 2,
};

struct Model {

  vsg::ref_ptr<render::MeshNode> render_zero_node;
  vsg::ref_ptr<render::MeshNode> render_mouse_node;
  bool render_update;
  bool render_clear;

  bool axis_update{false};

  // 鼠标拖拽按下像素位置
  bool drag;
  double drag_px{0}, drag_py{0};

  // 绘制矩形框
  bool box_exist{false};
  qlib::Rectangle::s_ptr box_rect;
  DrawBoxDirect box_direct{DrawBoxDirect::None};  // 框选方向：1: 左，2: 右
  render::BoxMesh box_mesh;
  bool box_render{false};
  vsg::ref_ptr<render::MeshNode> box_node;

  // 鼠标事件
  bool mouse_move{false};
  bool mouse_press{false};
  double mouse_press_x, mouse_press_y;
  bool mouse_release{false};
  bool key_shift_press{false};  // shift按键, 多选按键
  bool key_ctrl_press{false};   // 多选取消
};

}  // namespace qbe::axis